package com.jy.project.service.imp.defult;

import com.jy.project.ex.BizException;
import com.jy.project.service.MaterialService;
import com.jy.project.service.imp.abstr.AbstractApplyBusiness;
import com.jy.project.vo.MaterialVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("defaultApplyBusinessImp")
public class DefaultApplyBusinessImp extends AbstractApplyBusiness {
    @Autowired
    protected MaterialService materialService;

    @Override
    public void checkApplyNo(String applyNo) {

    }

    @Override
    public MaterialVO checkMaterialNo(String materialNo) {
        if (StringUtils.isEmpty(materialNo)){
            throw  new BizException("资产编号不能为空");
        }
        MaterialVO materialVO = materialService.getMaterialVO(materialNo);
        if (materialVO ==null){
            throw  new BizException("当前物资数据不存在");
        }
        return materialVO;
    }
}
